package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.ChatBoxInfo;
import com.ruoyi.system.domain.CustomerChat;
import com.ruoyi.system.domain.CustomerInfo;
import com.ruoyi.system.domain.FansInfo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Repository
public interface FansInfoMapper {

    public List<FansInfo> selectChatList(FansInfo customerChat);

    public List<FansInfo> selectChatListCusNumber(String[] contactNumber);

    public List<CustomerInfo> selectChatListContactNumber(String contactNumber);

    public List<FansInfo> selectToDayChatByIds(String contactNumber);

    public List<FansInfo> selectConversionsByCode(FansInfo customerChat);


    public List<FansInfo> selectChatByIds(String[] ids);

    //
    public FansInfo selectChatByClientNumber(String customerNumber);

    public int updateCustomerChat(FansInfo customerChat);

    public int updateDaysNumberByClientNumber(FansInfo customerChat);

    public int updateCustomerByClientNumber(FansInfo customerChat);

    /**
     * 新增客服信息
     *
     * @param user 客服信息
     * @return 结果
     */
    public int insertUser(FansInfo user);

    /**
     * 批量删除客服信息
     *
     * @param customerNumber whatsapp号码
     * @return 结果
     */
    public int deleteUserByNumbers(String[] customerNumber);

    public FansInfo selectChatById(String id);

    // 批量插入用户
    void batchInsertUsers(@Param("users") List<FansInfo> users);

    // 批量查询客户聊天信息
    @MapKey("clientNumber")
    Map<String, FansInfo> selectChatsByClientNumbers(@Param("clientNumbers") Set<String> clientNumbers);


    public int updateCustomerChatBycustomerNumber(FansInfo customerChat);

    public int updateCustomerByStatus(FansInfo customerChat);

    public int updateDaysNumberByCustomerNumber(FansInfo customerChat);

    public List<FansInfo> selectSendTotal(FansInfo customerChat);

    public List<FansInfo> selectToDaySendTotal(FansInfo customerChat);

    public List<FansInfo> selectClientTotal(FansInfo customerChat);

    public List<FansInfo> selectToDayClientTotal(FansInfo customerChat);

    public FansInfo selectChatByCustomerNumber(String customerNumber);

    public List<FansInfo> selectInLineCustomer(FansInfo customerChat);

    public List<ChatBoxInfo> getChatBoxList(String customerNumber);


}
